package com.zp.domain;

import lombok.Data;

import java.util.Objects;

/**
 * @author zp
 * @description
 * @created 2021/11/24 9:44
 */
@Data
public class RegisterDo {

    private String serviceName;

    private String serviceAddrUrl;

    private byte state;

    private long lastRenewalTime;

    public RegisterDo() {

    }

    public RegisterDo(String serviceName, String serviceAddrUrl, byte state, long lastRenewalTime) {
        this.serviceName = serviceName;
        this.serviceAddrUrl = serviceAddrUrl;
        this.state = state;
        this.lastRenewalTime = lastRenewalTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof RegisterDo)) return false;
        RegisterDo that = (RegisterDo) o;
        return getState() == that.getState() &&
                Objects.equals(getServiceName(), that.getServiceName()) &&
                Objects.equals(getServiceAddrUrl(), that.getServiceAddrUrl());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getServiceName(), getServiceAddrUrl(), getState());
    }

}
